home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00a.txt / 000077_icon-group-sender _Wed Apr 26 12:35:31 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  4KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id MAA12171
  4.     for icon-group-addresses; Wed, 26 Apr 2000 12:33:58 -0700 (MST)
  5. Message-Id: <200004261933.MAA12171@baskerville.CS.Arizona.EDU>
  6. From: Lloyd Uhler <luhler@excel.com>
  7. To: "'icon-group@cs.arizona.edu'" <icon-group@optima.CS.Arizona.EDU>
  8. Subject: Questions on ICON
  9. Date: Wed, 26 Apr 2000 08:52:28 -0500
  10. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  11. Status: RO
  12.  
  13. 1) For Version 9.3.1 on WIN NT and WIN 98, textbox input does not work for
  14. VIB generated code as follows:
  15.  
  16. ############################################################################
  17. #
  18. #    File:     C:\Icon9.3\vib_tst.icn
  19. #
  20. #    Subject:  Program to ...
  21. #
  22. #    Author:   
  23. #
  24. #    Date:     January 21, 1999
  25. #
  26. ############################################################################
  27. #
  28. #
  29. #
  30. ############################################################################
  31. #
  32. #  Requires:
  33. #
  34. ############################################################################
  35. #
  36. #  Links: vsetup
  37. #
  38. ############################################################################
  39.  
  40. #  This vib interface specification is a working program that responds
  41. #  to vidget events by printing messages.  Use a text editor to replace
  42. #  this skeletal program with your own code.  Retain the vib section at
  43. #  the end and use vib to make any changes to the interface.
  44.  
  45. link vsetup
  46.  
  47. procedure main(args)
  48.    local vidgets, root, paused
  49.  
  50.    (WOpen ! ui_atts()) | stop("can't open window")
  51.    vidgets := ui()                # set up vidgets
  52.    root := vidgets["root"]
  53.  
  54.    paused := 1                    # flag no work to do
  55.    repeat {
  56.       # handle any events that are available, or
  57.       # wait for events if there is no other work to do
  58.       while (*Pending() > 0) | \paused do {
  59.          ProcessEvent(root, QuitCheck)
  60.          }
  61.       # if <paused> is set null, code can be added here
  62.       # to perform useful work between checks for input
  63.       }
  64. end
  65.  
  66. procedure text_input_cb1(vidget, value)
  67. #    write("value = ", value)
  68.    return
  69. end
  70.  
  71. #===<<vib:begin>>===    modify using vib; do not remove this marker line
  72. procedure ui_atts()
  73.    return ["size=600,378", "bg=#C0C0C0"]
  74. end
  75.  
  76. procedure ui(win, cbk)
  77. return vsetup(win, cbk,
  78.    [":Sizer:::0,0,600,378:",],
  79.    ["button1:Button:regular::270,349,32,20:OK",button_cb1],
  80.    ["text_input1:Text::46:95,111,367,20:Enter Your
  81. Name:\\=",text_input_cb1],
  82.    )
  83. end
  84. #===<<vib:end>>===    end of section maintained by vib
  85. procedure button_cb1(vidget, value)
  86. #
  87.  
  88. #  write("button_cb1")
  89. #
  90. # This does not work with the original viface module
  91. # The local one has been revised to detect Window closure
  92. # and do this without error. This will return to the statement
  93. # after GetEvents. The program can then process or do what it
  94. # needs with the results for the GUI data capture. Data values
  95. # can be inserted into global variables so they are available
  96. # to the rest of the program.
  97. #
  98. #  WClose( &window )
  99.   return
  100. end
  101.  
  102. 2) There seems to be no way to gather a set of file names from a specified
  103. directory:
  104.     (System & popen do not work the same as command-line version of ICON
  105. (Nticont, Nticonx)).
  106.     (F.F and pipe.001 are empty)
  107.  
  108.  link graphics, dialog, popen, xio
  109.  
  110.  procedure main()
  111. #
  112. #
  113. # the 45 is the width
  114. #
  115.   txt := TextDialog("Specify Directory Path:",  "Path", "C:\\temp" , 45)
  116.  
  117.   Path := dialog_value[1]
  118.   write("Path = ", Path)
  119.  
  120.   cmd := "Dir /b/l "
  121. #
  122. # See if F.F Generated fro BAT File
  123. #
  124.   system( "CALL C:\\ICON9.3\\WDIR.CMD" || Path )
  125. #
  126. # Try popen to get file of file names
  127. #
  128.   fin := popen( cmd || Path, "r")
  129.   while line := trim(read(fin)) do write(line)
  130.  
  131.   pclose(fin)
  132.  
  133.  end
  134.  
  135. REM
  136. REM Wdir.BAT
  137. REM
  138. REM Purpose: Directory Listing
  139. REM
  140. DIR /b/l %1 > F.F
  141.